package com.scs.application.modules.dept.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.DataEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityIndexAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
/**
 * <p>
 *
 * </p>
 *
 */
@Data
@Accessors(chain = true)
@TableName("dept_apply_auto")
@EntityClassAnnotation(remark = "自动请领单,字段增加dept_apply_auto_history同步增加字段")
@EntityIndexAnnotation(ix = {"flag_transfer","apply_type","ref_type","ref_id","dept_id","demand_level","matr_id","warehouse_id"})
public class ApplyAuto extends DataEntity {
    // id ,在父类中处理
    @EntityFieldAnnotation(
            text = "明细类型",
            length = "15",
            not_null = false,
            default_value = "",
            comment = "采购:PURCHASE,配送:DIST "
    )
    private String refType;

    @EntityFieldAnnotation(
            text = "业务来源",
            length = "10",
            not_null = false,
            default_value = "",
            comment = "安全库存:SAFE_STOCK,科室需求:DEPT_APPLY"
    )
    private String refTable;


    @EntityFieldAnnotation(
            text = "调拨类型",
            length = "10",
            not_null = false,
            default_value = "",
            comment = "用后结算:out,出库结算:used"
    )
    private String settlementType;


    @EntityFieldAnnotation(
            type = EntityFieldType.LONG,
            text = "申请科室ID",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String deptId;

    @EntityFieldAnnotation(
            text = "申请科室名称",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String deptName;

    @EntityFieldAnnotation(
            text = "申请仓库ID",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String applyWarehouseId;

    @EntityFieldAnnotation(
            text = "申请仓库名称",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String applyWarehouseName;

    @EntityFieldAnnotation(
            text = "目标仓库ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String warehouseId;

    @EntityFieldAnnotation(
            text = "目标仓库名称",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String warehouseName;

    @EntityFieldAnnotation(
            text = "供应商ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String supplierId;

    @EntityFieldAnnotation(
            text = "供应商名称",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String supplierName;

    @EntityFieldAnnotation(
            text = "厂商ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = "厂商ID"
    )
    private String mfgId;

    @EntityFieldAnnotation(
            text = "厂商名称",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "厂商名称"
    )
    private String mfgName;

    @EntityFieldAnnotation(
            text = "物料ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String matrId;

    @EntityFieldAnnotation(
            text = "物料名称",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String matrName;

    @EntityFieldAnnotation(
            text = "库存量显示",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String stockQtyShow;

    @EntityFieldAnnotation(
            text = "物料品规",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String matrSpec;

    @EntityFieldAnnotation(
            text = "单位",
            length = "10",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String skuUnit;

    @EntityFieldAnnotation(
            text = "日消耗量",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Double skuQtyDaily;

    @EntityFieldAnnotation(
            text = "在途数量",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Double onWayQty;


    @EntityFieldAnnotation(
            text = "关联订单Id",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String refOrderId;

    @EntityFieldAnnotation(
            text = "安全库存",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double skuQtySafety;

    @EntityFieldAnnotation(
            text = "最佳库存",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Double skuQtyPerfect;

    @EntityFieldAnnotation(
            text = "申请类型",
            length = "4",
            not_null = false,
            default_value = "",
            comment = "1请领,2 需求"
    )
    private String applyType;

    @EntityFieldAnnotation(
            text = "要求单位",
            length = "10",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String requiredUnit;

    @EntityFieldAnnotation(
            text = "要求单位比率",
            length = "10",
            not_null = false,
            default_value = "1",
            comment = ""
    )
    private Double requiredRate;


    @EntityFieldAnnotation(
            text = "请领时间",
            length = "",
            not_null = false,
            default_value = "",
            comment = "自动请领时间"
    )
    private LocalDateTime gmtApply;

    @EntityFieldAnnotation(
            text = "最新请领仓库库存数量",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Double skuQtyStock;
    @EntityFieldAnnotation(
            text = "最初需求单品数量",
            length = "",
            not_null = false,
            default_value = "",
            comment = "主要用在 科室请领需求业务和挂单业务"
    )
    private Double skuQtyApply0;

    @EntityFieldAnnotation(
            text = "最初需求包装数量",
            length = "",
            not_null = false,
            default_value = "",
            comment = "主要用在 科室请领需求业务和挂单业务"
    )
    private Double demandPackageQty0;

    @EntityFieldAnnotation(
            text = "自动请领/采购数量",
            length = "",
            not_null = false,
            default_value = "",
            comment = "最新的定时任务而更新"
    )
    private Double skuQtyApply;

    @EntityFieldAnnotation(
            text = "需补包装数量",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Double demandPackageQty;

    @EntityFieldAnnotation(
            text = "最后更新时间",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private LocalDateTime gmtUpdate;

    @EntityFieldAnnotation(
            text = "关联配送单/调拨单ID  | null:未响应",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String refId;



    @EntityFieldAnnotation(
            text = "拣货情况",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String pickMsg;


    @EntityFieldAnnotation(
            text = "来源请领明细id",
            length = "20",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String refApplyItemId;

    @EntityFieldAnnotation(
            text = "采购时间",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private LocalDateTime gmtPurchase;

    @EntityFieldAnnotation(
            text = "响应时间：配送调拨的创建时间",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private LocalDateTime gmtResponse;

    @EntityFieldAnnotation(
            text = "完成时间：配送调拨单的收货时间",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private LocalDateTime gmtComplete;

    @EntityFieldAnnotation(
            text = "是否是调拨 | 1:调拨 | 0:配送",
            length = "",
            not_null = true,
            default_value = "1",
            comment = ""
    )
    private Boolean flagTransfer;

    @EntityFieldAnnotation(
            text = "已拣货单品数量",
            length = "",
            not_null = true,
            default_value = "0.0000",
            comment = ""
    )
    private Double pickedSkuQty;

    @EntityFieldAnnotation(
            text = "已拣货包装数量",
            length = "",
            not_null = false,
            default_value = "0.0000",
            comment = ""
    )
    private Double pickedPackageQty;

    @EntityFieldAnnotation(
            text = "备注",
            length = "300",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String remark;


    /**
     * 配送仓库默认库位id
     */
    @TableField(exist = false)
    private String locationIdDist;

    /**
     * 配送仓库默认库位名称
     */
    @TableField(exist = false)
    private String locationNameDist;

    /**
     * 配送仓库默认库位代码
     */
    @TableField(exist = false)
    private String locationIdCodeDist;


    /**
     * 接收仓库默认库位id
     */
    @TableField(exist = false)
    private String locationIdReceive;

    /**
     * 接收仓库默认库位名称
     */
    @TableField(exist = false)
    private String locationNameReceive;

    /**
     * 接收仓库默认库位代码
     */
    @TableField(exist = false)
    private String locationIdCodeReceive;

    @EntityFieldAnnotation(
            text = "需求级别",
            not_null = false,
            default_value = "0",
            comment = "0常规，1紧急，特别紧急"
    )
    private String demandLevel;

    /**
     * 是否响应
     */
    @TableField(exist = false)
    private Boolean flagResponse;

    //耗材分类 matr:耗材，reagent：试剂，drugs：药品
    @TableField(exist = false)
    private String  matrBaseType;

    @EntityFieldAnnotation(
            text = "耗材型号",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "耗材型号"
    )
    private String matrModel;

    @EntityFieldAnnotation(
            text = "开单单位",
            length = "10",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String billPackageUnit;


    @EntityFieldAnnotation(
            text = "开单单位比率",
            length = "10",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Double billPackageRate;


    @EntityFieldAnnotation(
            text = "开单单位数量",
            length = "10",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Double billPackageQty;


    @EntityFieldAnnotation(
            text = "单品单价(元)",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double skuPrice;

    @EntityFieldAnnotation(
            text = "关联业务单号",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String busKey;

    @EntityFieldAnnotation(
            text = "一物一码管理标志",
            length = "",
            not_null = true,
            default_value = "0",
            comment = "一物一码"
    )
    private Boolean flagOmoc;

    @EntityFieldAnnotation(
            text = "供应室标志",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "供应室标志"
    )
    private Boolean flagGys;

    @EntityFieldAnnotation(
            text = "申请人",
            length = "",
            not_null = false,
            default_value = "",
            comment = "申请人"
    )
    private String applyUser;

    @EntityFieldAnnotation(
            text = "试剂组id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = ""
    )
    private String reagentTeamId;

}
